cmake_minimum_required(VERSION 3.10)
project(client1)

#目标操作系统
SET(CMAKE_SYSTEM_NAME Linux)
#编译器路径
SET(PROJECT_COMPILE_TOOL_PATH /usr/local/arm/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu ) 
#C编译器路径
SET(CMAKE_C_COMPILER   ${PROJECT_COMPILE_TOOL_PATH}/bin/aarch64-linux-gnu-gcc)
#C++编译器路径
SET(CMAKE_CXX_COMPILER ${PROJECT_COMPILE_TOOL_PATH}/bin/aarch64-linux-gnu-g++)

# 其他依赖库
find_package(Threads REQUIRED)

set(opencv_include_DIR /home/ubuntu/Downloads/opencv_for_armlinux/install/include/opencv4)# 设置OpenCV的include路径
set(opencv_lib_DIR /home/ubuntu/Downloads/opencv_for_armlinux/install/lib)# 设置OpenCV的lib路径

include_directories(${opencv_include_DIR})# 设置包含的头文件路径
link_directories(${opencv_lib_DIR})# 设置库文件路径


# 你的项目头文件目录
include_directories(${PROJECT_SOURCE_DIR}/inc)
include_directories(${PROJECT_SOURCE_DIR}/mavlink_v1)
include_directories(${PROJECT_SOURCE_DIR}/mavlink_v1/common)

# 链接目录（如果需要）
link_directories(${PROJECT_SOURCE_DIR}/inc)
link_directories(${PROJECT_SOURCE_DIR}/mavlink_v1)
link_directories(${PROJECT_SOURCE_DIR}/mavlink_v1/common)

# 源文件目录
aux_source_directory(./usr SRC)
aux_source_directory(./src SRC)

# 声明可执行文件
add_executable(client1 ${SRC})

# 链接线程库
target_link_libraries(client1 Threads::Threads)
# 连接实时库
target_link_libraries(client1 rt)

# 链接 OpenCV 库
file(GLOB LIBRARIES ${opencv_lib_DIR}/*.so) #链接 lib 文件夹下所有的库文件 假设是 .so 文件，如果是其他格式，请相应调整
target_link_libraries(client1 ${LIBRARIES})
